home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / ply15dat.zip / ROBARM.INC < prev    next >
Text File  |  1992-10-20  |  6KB  |  209 lines

  1. // These first four values are normally all that needs to be changed
  2. // in order to position the arm the way you want it.  (Of course
  3. // calculation of the correct values can be tough.)
  4. define pincher_angle         degrees(robot_arm_theta)
  5. define wrist_rotation_angles <90, 0, degrees(robot_arm_beta)>
  6.  
  7. // Sizes of the various parts of the robot arm
  8. define stand_height       3
  9. define wrist1_radius      0.3
  10. define wrist1_length      0.4
  11. define wrist_radius       0.3
  12. define wrist_length       0.4
  13. define section1_length    4
  14. define section2_length    4
  15. define pincher_length     2
  16. define pincher_width      pincher_length/7
  17. define pincher_height     pincher_length/12
  18. define finger_length      1.5
  19. define finger_axis_length pincher_length/6.9
  20. define finger_axis_radius pincher_length/6
  21.  
  22. // stand_orientation moves and orients the entire robot arm
  23. define stand_orientation
  24. transform {
  25.    rotate <0, 0, 0> // Valid from <0, -180, 0> to <0, 180, 0>
  26.    }
  27.  
  28. // arm_orientation moves the entire arm around the support
  29. define arm_orientation
  30. transform {
  31.    rotate <0, 0, -degrees(robot_arm_beta)>
  32.    rotate <0, degrees(robot_arm_alpha), 0>
  33.    translate <0, stand_height, 0>
  34.    }
  35.  
  36. define wrist1_orientation
  37. transform {
  38.    rotate wrist_rotation_angles
  39.    translate <section2_length, 0, 0>
  40.    }
  41.  
  42. // rotation of the entire wrist
  43. define wrist_orientation
  44. transform {
  45.    rotate <0, 0, 0>    // Valid from <-45, 0, -180> to <45, 0, 180>
  46.    }
  47.  
  48. // arm_extension defines how far the second arm piece extends
  49. // from the first pieces
  50. define arm_extension
  51. transform {
  52.    translate <section2_offset, 0, 0> // Valid from <1, 0, 0> to <4, 0, 0>
  53.    }
  54.  
  55. define top_finger_orientation
  56. transform {
  57.    rotate <0, 0, pincher_angle>
  58.    translate <pincher_length, 0, 0>
  59.    }
  60.  
  61. define bottom_finger_orientation
  62. transform {
  63.    rotate <0, 0, -pincher_angle>
  64.    translate <pincher_length, 0, 0>
  65.    }
  66.  
  67. // The two pincher orientations determine if the hand is open or closed
  68. define top_pincher_orientation
  69. transform {
  70.    rotate <0, 0, -pincher_angle>
  71.    translate <0, 0.1, 0>
  72.    }
  73.  
  74. define bottom_pincher_orientation
  75. transform {
  76.    rotate <0, 0, pincher_angle>
  77.    translate <0, -0.1, 0>
  78.    }
  79.  
  80. define wrist_base_axis
  81. object {
  82.    // Axis for the wrist
  83.      object { cylinder <0, 0, -wrist_length>, <0, 0, wrist_length>, wrist_radius }
  84.    + object { disc <0, 0, -wrist_length>, <0, 0, -1>, wrist_radius }
  85.    + object { disc <0, 0, wrist_length>, <0, 0, 1>, wrist_radius }
  86.    brass
  87.    }
  88.  
  89. define finger
  90. object {
  91.      object {
  92.       cylinder <0, 0, -finger_axis_length>,
  93.                <0, 0,  finger_axis_length>,
  94.                finger_axis_radius
  95.       brass
  96.       }
  97.    + object {
  98.       disc <0, 0, -finger_axis_length>, <0, 0, -1>, finger_axis_radius
  99.       brass
  100.       }
  101.    + object {
  102.       disc <0, 0, finger_axis_length>, <0, 0, 1>, finger_axis_radius
  103.       brass
  104.       }
  105.    + object {
  106.       box <0, -pincher_height, -pincher_width>, 
  107.           <finger_length, pincher_height, pincher_width>
  108.       matte_blue
  109.       }
  110.    }
  111.  
  112. define pincher
  113. object {
  114.    box <0, -pincher_height, -pincher_width>, 
  115.        <pincher_length, pincher_height,  pincher_width>
  116.    matte_blue
  117.    }
  118.  
  119. define wrist_and_hand
  120. object {
  121.    wrist_base_axis
  122.    + object {
  123.           pincher
  124.         + finger { top_finger_orientation }
  125.         top_pincher_orientation
  126.         }
  127.    + object {
  128.           pincher
  129.         + finger { bottom_finger_orientation }
  130.         bottom_pincher_orientation
  131.         }
  132.    wrist_orientation
  133.    }
  134.  
  135. define complete_hand
  136. object {
  137.      object { cylinder <0, -wrist1_length, 0>, <0, wrist1_length, 0>,
  138.                        wrist1_radius
  139.               brass }
  140.    + object { disc <0, -wrist1_length, 0>, <0, -1, 0>, wrist1_radius brass }
  141.    + object { disc <0,  wrist1_length, 0>, <0,  1, 0>, wrist1_radius brass }
  142.    + wrist_and_hand { translate <wrist1_radius, 0, 0> }
  143.    wrist1_orientation
  144.    }
  145.  
  146. define arm_section2
  147. object {
  148.    // Base part of the arm
  149.      object { cylinder <0, 0, 0>, <section2_length, 0, 0>, 0.2 }
  150.    + object { disc <section2_length, 0, 0>, <1, 0, 0>, 0.2 }
  151.    + complete_hand
  152.    arm_extension
  153.    chrome
  154.    }
  155.  
  156. define arm_section_sleeve
  157. object {
  158.      object { cylinder <-0.5, 0, 0>, <0.5, 0, 0>, 0.4 }
  159.    + object { disc <0.5, 0, 0>, <-1, 0, 0>, 0.4 }
  160.    + object { disc <0.5, 0, 0>, <1, 0, 0>, 0.4 }
  161.    brass
  162.    }
  163.  
  164. define arm_counterweight
  165. object {
  166.      object { cylinder <0, 0, 0>, <section1_length/4, 0, 0>, 0.5 }
  167.    + object { disc <0, 0, 0>, <-1, 0, 0>, 0.5 }
  168.    + object { disc <section1_length/4, 0, 0>, <1, 0, 0>, 0.5 }
  169.    brass
  170.    }
  171.  
  172. define arm_section1
  173. object {
  174.    // Base part of the arm
  175.      object { cylinder <-section1_length/1.5, 0, 0>,
  176.                        <section1_length/1.5, 0, 0>, 0.3 }
  177.    + object { disc <section1_length/1.5, 0, 0>, <0, 0, 1>, 0.3 }
  178.    + arm_section_sleeve { translate <section1_length/1.5, 0, 0> }
  179.    + arm_counterweight { translate <-section1_length/1.3, 0, 0> }
  180.    chrome
  181.    }
  182.  
  183. define arm_base
  184. object {
  185.    // Axis for the arm
  186.      object { cylinder <0, 0, -0.5>, <0, 0, 0.5>, 0.5 }
  187.    + object { disc <0, 0, -0.5>, <0, 0, -1>, 0.5 }
  188.    + object { disc <0, 0, 0.5>, <0, 0, 1>, 0.5 }
  189.    brass
  190.    }
  191.  
  192. define arm
  193. object {
  194.    arm_base + arm_section1 + arm_section2
  195.    arm_orientation
  196.    }
  197.  
  198. define stand
  199. object {
  200.      object { box <-2, 0, -2>, <2, 1, 2> brass }
  201.    + object { cylinder <0, 1, 0>, <0, 2, 0>, 1 brass }
  202.    + object { disc <0, 2, 0>, <0, 1, 0>, 1 brass }
  203.    + object { cylinder <0, 2, 0>, <0, 3, 0>, 0.3 chrome }
  204.    + object { disc <0, 3, 0>, <0, 1, 0>, 0.3 chrome }
  205.    }
  206.  
  207. define robot_arm
  208. object { stand { rotate <0, 30, 0> } + arm stand_orientation }
  209.